package Engine;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import Engine.util.JdbcConnection;

public class AddGuild {
	public static void main(String args[]) {
		try {
		Connection conn = new JdbcConnection().getConnection();
		PreparedStatement pst = conn.prepareStatement("insert into guild_list (guild, realm) select distinct guild, realm from player_list where guild <> '' and guild not in (select distinct guild from guild_list) ") ;
		int count = pst.executeUpdate();
		System.out.println("Added " + count + " guilds.");
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}

}
